package com.xc.stock.constant;

/**
 * @author xlfd
 * @email xlfd@gmail.com
 * @version 1.0
 * @created Jan 13, 2021 11:53:31 AM
 */
public enum AppVersionUpdateTag {
	LATEST("latest", "最新版本,无需更新"),
    AUDIT("audit", "审核版本"),
    UPDATE_CHOOSE("choose_update", "选择更新"),
    UPDATE_MUST("must_update", "强制更新");
	;

	String code;
	String remark;
	AppVersionUpdateTag(String code, String remark) {
		this.code = code;
		this.remark = remark;
	}

	public String code() {
		return code;
	}

	public String remark() {
		return remark;
	}

	public static String remark(String code) {
		AppVersionUpdateTag of = of(code);
		return of == null ? "" : of.remark;
 	}
	
	public static AppVersionUpdateTag of(String code) {
		AppVersionUpdateTag[] values = AppVersionUpdateTag.values();
		for (AppVersionUpdateTag e : values) {
			if (e.code.equals(code)) {
				return e;
			}
		}

		return null;
	}
}
